import { reactive, watch, SetupContext } from 'vue'
interface DataType {
  isShow: boolean;
  close: () => void;
}
export default function dialog(props: any, context: SetupContext<(any)[]>) {
  const close = () => {
    context.emit('close')
  }
  const dialogM = reactive<DataType>({
    isShow: false,
    close: close
  })
  watch(() => props.value, (val) => {
    dialogM.isShow = val
  })
  return {
    dialogM
  }
}
